# signals.py
from django.db.models.signals import post_save
from django.dispatch import receiver
from .models import Task

@receiver(post_save, sender=Task)
def notify_students(sender, instance, created, **kwargs):
    if created:
        # 模拟通知学生
        print(f"通知学生：新任务 '{instance.title}' 已发布！")